using System;
using System.Text;
using System.Reflection;
using System.ServiceModel;
using System.Collections.Generic;
using System.Runtime.Serialization;
using TDS = Tridion.ContentManager.Interop.TDS;
using TDSDefines = Tridion.ContentManager.Interop.TDSDefines;



#pragma warning disable 649
namespace Tridion.Gateway
{
	[DataContract]
	public class Publication:Facade
	{
        internal Publication(TDS.Publication Publication, bool ShallowCopy)
            : base(typeof(TDS._Publication), Publication, ShallowCopy)
		{
		}

		[DataMember(Name="ItemType")]
		private TDSDefines.ItemType itemtype;
		public TDSDefines.ItemType ItemType
		{
			 get { return itemtype; }
		}


		[DataMember(Name="ID")]
		private String id;
		public String ID
		{
			 get { return id; }
		}


		[DataMember(Name="Info")]
		private Info info;
		public Info Info
		{
			 get { return info; }
		}


		[DataMember(Name="Title")]
		private String title;
		public String Title
		{
			 get { return title; }
			 set { title = value; }
		}


        [DataMember(Name = "DefaultPageTemplate")]
        private PageTemplate defaultpagetemplate;
        public PageTemplate DefaultPageTemplate
        {
            get { return defaultpagetemplate; }
            set { defaultpagetemplate = value; }
        }


        [DataMember(Name = "RootFolder")]
        private Folder rootfolder;
        public Folder RootFolder
        {
            get { return rootfolder; }
        }


        [DataMember(Name = "RootStructureGroup")]
        private StructureGroup rootstructuregroup;
        public StructureGroup RootStructureGroup
        {
            get { return rootstructuregroup; }
        }


        [DataMember(Name = "PageTemplateProcess")]
        private ProcessDefinition pagetemplateprocess;
        public ProcessDefinition PageTemplateProcess
        {
            get { return pagetemplateprocess; }
            set { pagetemplateprocess = value; }
        }


        [DataMember(Name = "ComponentTemplateProcess")]
        private ProcessDefinition componenttemplateprocess;
        public ProcessDefinition ComponentTemplateProcess
        {
            get { return componenttemplateprocess; }
            set { componenttemplateprocess = value; }
        }


        [DataMember(Name = "ShareProcessAssociations")]
        private Boolean shareprocessassociations;
        public Boolean ShareProcessAssociations
        {
            get { return shareprocessassociations; }
            set { shareprocessassociations = value; }
        }


        [DataMember(Name = "ComponentSnapshotTemplate")]
        private ComponentTemplate componentsnapshottemplate;
        public ComponentTemplate ComponentSnapshotTemplate
        {
            get { return componentsnapshottemplate; }
            set { componentsnapshottemplate = value; }
        }


        [DataMember(Name = "PageSnapshotTemplate")]
        private PageTemplate pagesnapshottemplate;
        public PageTemplate PageSnapshotTemplate
        {
            get { return pagesnapshottemplate; }
            set { pagesnapshottemplate = value; }
        }


        [DataMember(Name = "IsChildPublication")]
        private Boolean ischildpublication;
        public Boolean IsChildPublication
        {
            get { return ischildpublication; }
        }


        [DataMember(Name = "ParentPublications")]
        PublicationURI[] parentpublications; 
        public PublicationURI[] ParentPublications
        {
            get { return parentpublications;  }
            set { parentpublications = value; }
        }


        [DataMember(Name = "MetadataSchema")]
        private Schema metadataschema;
        public Schema MetadataSchema
        {
            get { return metadataschema; }
            set { metadataschema = value; }
        }


        //TODO:Fix
        [DataMember(Name = "MetadataFields")]
        private ItemField[] metadatafields;
        public ItemField[] MetadataFields
        {
            get { return metadatafields; }
        }


		[DataMember(Name="PublicationPath")]
		private String publicationpath;
		public String PublicationPath
		{
			 get { return publicationpath; }
			 set { publicationpath = value; }
		}


		[DataMember(Name="MultimediaPath")]
		private String multimediapath;
		public String MultimediaPath
		{
			 get { return multimediapath; }
			 set { multimediapath = value; }
		}


		[DataMember(Name="PublicationURL")]
		private String publicationurl;
		public String PublicationURL
		{
			 get { return publicationurl; }
			 set { publicationurl = value; }
		}


		[DataMember(Name="MultimediaURL")]
		private String multimediaurl;
		public String MultimediaURL
		{
			 get { return multimediaurl; }
			 set { multimediaurl = value; }
		}


        [DataMember(Name = "DefaultComponentTemplate")]
        private ComponentTemplate defaultcomponenttemplate;
        public ComponentTemplate DefaultComponentTemplate
        {
            get { return defaultcomponenttemplate; }
            set { defaultcomponenttemplate = value; }
        }


        [DataMember(Name = "DefaultTemplateBuildingBlock")]
        private TemplateBuildingBlock defaulttemplatebuildingblock;
        public TemplateBuildingBlock DefaultTemplateBuildingBlock
        {
            get { return defaulttemplatebuildingblock; }
            set { defaulttemplatebuildingblock = value; }
        }


        [DataMember(Name = "DefaultMultimediaSchema")]
        private Schema defaultmultimediaschema;
        public Schema DefaultMultimediaSchema
        {
            get { return defaultmultimediaschema; }
            set { defaultmultimediaschema = value; }
        }


        protected override void Initialize(FieldInfo field, PropertyInfo property, Object value)
        {
            //switch (field.Name)
            //{
            //    case "parentpublications":
            //        object o = property.GetValue(value, null);
            //        foreach (TDS.Publication p in ((TDS.Publications)o))
            //        {
            //            parentpublications.Add(new PublicationURI(p));
            //        }
            //        break;
            //}
        }

		//protected override void Initialize(FieldInfo field, Object value)
		//{
            //switch (field.Name)
            //{
            //    case "parentpublications":
            //        //foreach (TDS.Publication p in ((TDS.Publications)value))
            //        //{
            //        //    parentpublications.Add(new PublicationURI(p));
            //        //}
            //        break;
            //}
		//}
	}
}

/*
			System.String GetTaxonomies(Tridion.ContentManager.Interop.TDS.ListRowFilter)
			Tridion.ContentManager.Interop.TDS.Users GetUsers()
			Tridion.ContentManager.Interop.TDS.Groups GetGroups()
			System.String GetListTrustees(Tridion.ContentManager.Interop.TDSDefines.TrusteeType, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter)
			System.String GetListTargetGroups(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter)
			System.String GetListTargetTypes(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter)
			System.String GetListCategories(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			Tridion.ContentManager.Interop.TDS.Categories GetCategories(Tridion.ContentManager.Interop.TDS.ListRowFilter)
			System.String GetListItems(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			System.String GetListComponentTemplates(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			Tridion.ContentManager.Interop.TDS.PublicationTargets GetPublicationTargets()
			System.String GetListOrganizationalItems(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			System.String GetListTaxonomies(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			System.String GetListOrphanKeywords(Tridion.ContentManager.Interop.TDSDefines.EnumKeywordSortType, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			Tridion.ContentManager.Interop.TDS.Keywords GetOrphanKeywords(Tridion.ContentManager.Interop.TDSDefines.EnumKeywordSortType, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			System.String GetXML(Tridion.ContentManager.Interop.TDSDefines.XMLReadFilter)
			Void UpdateXML(System.String)
			Void Save(Boolean)
			Void Delete()
			System.String GetPath()
			System.String Publish(System.Object, Boolean, Boolean, Boolean, System.DateTime, System.DateTime, System.DateTime, Boolean, Tridion.ContentManager.Interop.TDSDefines.EnumPublishPriority, Boolean, Int32)
			System.String UnPublish(System.Object, Boolean, Boolean, Boolean, System.DateTime, Boolean, Tridion.ContentManager.Interop.TDSDefines.EnumPublishPriority)
			System.String GetListPathToCategory(System.Object, Tridion.ContentManager.Interop.TDSDefines.EnumKeywordSortType, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter)
			System.String GetListPublishItems(System.Object, Boolean, Boolean, Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
			System.String GetAllValidParentsXML(System.String)
			Boolean IsParentPublication()
*/
